<%@ page import="com.aiden.utils.CookieUtil" %>
<%--
  Created by IntelliJ IDEA.
  User: 云哥
  Date: 2023-05-19
  Time: 16:01
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>微博登录</title>
</head>
<body>
<h1>微博登录</h1>
<%
    //获取cookie
    String username= CookieUtil.getCookieVal("username",request);
    String password=CookieUtil.getCookieVal("password",request);

    String errorMsg =(String)request.getAttribute("errorMsg");
    if(errorMsg!=null){%>
    <p style="color: red"><%=errorMsg%></p>
<% request.removeAttribute("errorMsg");
    }%>

<form action="do_login.jsp" method="post" id="loginForm">
    <p>用户名：<input type="text" name="username" placeholder="请输入用户名" required value="<%=username%>"></p>
    <p>密&nbsp;&nbsp;&nbsp;&nbsp;码：<input type="password" name="password" placeholder="请输入密码" required value="<%=password%>"></p>
    <p><input type="checkbox" name="autoLogin" id="autoLogin" >
        <lable for="autoLogin">自动登录</lable></p>
    <p><button type="submit">登录</button></p>
</form>


</body>
</html>
